home *** CD-ROM | disk | FTP | other *** search
/ NOVA - For the NeXT Workstation / NOVA - For the NeXT Workstation.iso / Apps / Utilities / Other / TimeMon / TimeMonWraps.psw < prev   
Text File  |  1992-12-26  |  2KB  |  78 lines

  1. /*
  2.   TimeMonWraps.psw
  3.  
  4.     Drawing code for use by the Percentages class.
  5.  
  6.   Copyright 1991 Scott Hess.  Permission to use, copy, modify, and
  7.   distribute this software and its documentation for any purpose
  8.   and without fee is hereby granted, provided that this copyright
  9.   notice appear in all copies.  The copyright notice need not appear
  10.   on binary-only distributions - just in source code.
  11.   
  12.   Scott Hess makes no representations about the suitability of this
  13.   software for any purpose.  It is provided "as is" without express
  14.   or implied warranty.
  15. */
  16. defineps drawInit()
  17.   /_doDrawArc1 {        %% bdeg ddeg radius
  18.     /rad exch def
  19.  
  20.     %% White circle in back.
  21.     1.0 setgray
  22.     24 24 moveto
  23.     24 24 rad 0 360 arc
  24.     fill
  25.  
  26.     %% Dark gray "pie" slice.
  27.     0.333 setgray
  28.     24 24 moveto
  29.     24 24 rad 90 4 index arcn
  30.     fill
  31.     pop
  32.  
  33.     %% Black slice.
  34.     0.0 setgray
  35.     24 24 moveto
  36.     24 24 rad 90 4 index arcn
  37.     fill
  38.     pop
  39.   } bind def
  40.   /_doDrawArc2 {        %% bdeg ddeg ldeg radius
  41.     /rad exch def
  42.  
  43.     %% Background.
  44.     1.0 setgray
  45.     24 24 moveto
  46.     24 24 rad 0 360 arc
  47.     fill
  48.  
  49.     %% Light gray slice.
  50.     0.666 setgray
  51.     24 24 moveto
  52.     24 24 rad 90 4 index arcn
  53.     fill
  54.     pop
  55.  
  56.     %% Dark gray slice.
  57.     0.333 setgray
  58.     24 24 moveto
  59.     24 24 rad 90 4 index arcn
  60.     fill
  61.     pop
  62.  
  63.     %% Black slice.
  64.     0.0 setgray
  65.     24 24 moveto
  66.     24 24 rad 90 4 index arcn
  67.     fill
  68.     pop
  69.   } bind def
  70. endps
  71.     /* These cover for the pre-loaded procedures. */
  72. defineps drawArc1( double radius, bdeg, ddeg)
  73.   bdeg ddeg radius _doDrawArc1
  74. endps
  75. defineps drawArc2( double radius, bdeg, ddeg, ldeg)
  76.   bdeg ddeg ldeg radius _doDrawArc2
  77. endps
  78.